import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: Alex
 * Date: 8/15/13
 * Time: 11:06 AM
 * To change this template use File | Settings | File Templates.
 */
public class Main {
    private static final Logger log = Logger.getLogger(Main.class);

    public static void main(String[] args) {
        log.info("starting application at " + new Date().toString());
        try {
            ApplicationContainer container =
                    new ApplicationContainer(
                            new XServer("local.com"),
                            new ClassPathXmlApplicationContext("spring-config.xml"),
                            new ClassPathXmlApplicationContext("core-config.xml"));
            container.startMessanger();
        } catch (Exception error) {
            error.printStackTrace();
            log.fatal(error.getMessage());
            System.exit(1);
        }
    }
}
